#include<iostream>
using namespace std;
typedef long long LL;
const int N = 1e4 + 10;
LL f[N];
int n, m;
int main()
{
	cin >> n >> m;
	f[0] = 1;
	int x;
	for (int i = 1; i <= n; i++) {
		cin >> x;
		for (int j = x; j <= m; j++) {
			f[j] += f[j - x];
		}
	}
	cout << f[m] << endl;
	return 0;
}